﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace SignalBox.Core.Model.Timetable
{
    public class StopAtLocationAction : LocationAction 
    {

        public string DepartureTime
        {
            get;
            set;
        }

        public int WaitTime
        {
            get;
            set;
        }


        public override string GetDescription()
        {
            return "Stop at " + (Location == null ? "" : Location) + " and depart at " + (DepartureTime == null ? 
                                                                                              "" : 
                                                                                              DepartureTime);

        }

        public override System.Xml.Linq.XElement ToXml()
        {
            return new XElement("ScheduleAction",
                new XElement("Type", "StopAtLocation"),
                new XElement("Location", Location),
                new XElement("Time", Time),
                new XElement("WaitTime", WaitTime),
                new XElement("DepartureTime", DepartureTime)
                );
        }
    }
}
